package com.bbdjt.weixin.util;

public class EmojiFilter {

	public static String removeNonBmpUnicode(String str) {  
		   if (str == null) {  
		       return null;  
		   }  
		   str = str.replaceAll("[^\\u0000-\\uFFFF]", "");  
		   //"[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]"
		   //emoji 过滤
		  return str;  
		}  
	
	public static void main(String[] args) {
		String source = "我是喜二蛋";
		System.out.println(removeNonBmpUnicode(source));
	}
}
